<?php include_partial('global/navbar') ?>

<div class="next_head">
    <div class="wrap">待回款</div>
</div>
<div class="content_nav">
        <div class="tag_nav wrap">
            <div class="col-xs-3 pd-n">
                <p class="tit-p p-lg">全部待收本息</p>
                <p class="alt-p p-lg"><?php echo sfConfig::get('app_symbol').number_format($all['current_money'],2)?></p>
            </div>
            <div class="col-xs-9 pd-n">
                <div class="col-xs-4 pd-n">
                    <p class="tit-p">本月</p>
                    <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($td_month_repaymenting['current_money'],2)?></p>
                </div>
                <div class="col-xs-4 pd-n">
                    <p class="tit-p">下月</p>
                    <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($next_month_repaymenting['current_money'],2)?></p>
                </div>
                <div class="col-xs-4 pd-n">
                    <p class="tit-p">本年</p>
                    <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($td_year_repaymenting['current_money'],2)?></p>
                </div>
            </div>
        </div>
    
    <div class="tag_nav wrap">
        <div class="col-xs-12 pd-n">
            <form class="form-inline" role="form" action="<?php echo url_for('account/await')?>" method="POST">
                <div class="form-group ft-l">
                    <label class="ft-l control-label sch-lb" for="">查询时间</label>
                    <input type="text" value="<?php if($startDate):?><?php echo $startDate?><?php endif;?>" onkeydown="return false;" onkeyup="return false;"   class="ft-l form-control sch" id="startDate" name="startDate">
                </div>
                <div class="form-group ft-l">
                    <label class="ft-l control-label sch-lb" for="">到</label>
                    <input type="text" value="<?php if($endDate):?><?php echo $endDate?><?php endif;?>" onkeydown="return false;" onkeyup="return false;"   class="ft-l form-control sch" id="endDate" name="endDate">
                </div>
                <button type="submit" class="btn btn-primary">查询</button>
            </form>
        </div>
        <?php if($pager->getNbResults() >0):?>
     
            <div class="col-xs-12 pd-n">
                <hr />
                <h4>待收本息<span><?php echo sfConfig::get('app_symbol').number_format($current_money['current_money'],2);?></span></h4>
                <hr />
                <table class="table table-hover ">
                    <thead>
                        <tr>
                            <th>借款标题</th>
                            <th>还款日</th>
                            <th>借款人</th>
                            <th>期数/总期数</th>
                            <th>本金/本息</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($pager->getResults() as $one_result):?>
     
                            <?php $loan = $one_result->getLoan();?>
                            <tr>
                                <td><a href="<?php echo url_for('project/index?id='.$loan->getId())?>"><?php echo $loan->getTitle()?></a></td>
                                <td><?php echo date("Y-m-d",strtotime($one_result->getCurrentEndTime()))?> </td>
                                <td><?php echo $loan->getUserName();?></td>
                                <td><?php echo $one_result->getPeriodization();?> / <?php echo $one_result->getLoanTermNum()?></td>
                                <td><?php echo sfConfig::get('app_symbol').number_format($one_result->getCurrentPrincipalMoney(),2);?> / <?php echo sfConfig::get('app_symbol').number_format($one_result->getCurrentMoney(),2);?></td>
                            </tr>
                        <?php endforeach;?>
                    </tbody>
                </table>
            </div>
            <?php $uri = url_for("account/await");?>
            <ul class="pagination pagination-lg ft-r">
            <?php echo pager_navigation($pager, $uri); ?>
            </ul>
        <?php else:?>
         <div class="tag_nav wrap">
            <div class="nodata">
                该时间段无回款计划
            </div>
        </div>
        <?php endif;?>
    </div>
</div>

<script>
    $('#startDate').datetimepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView: 'decade'
    });
    $('#endDate').datetimepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView: 'decade'
    });
    $("#10008,#10003").addClass("on");
</script>
